<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta http-equiv="Content-Language" content="es">
        <meta name="Robots" content="all">
        <meta name="Distribution" content="global">
        <meta name="description" content="iRestauranting monitoriza las principales páginas sobre restauración, valoramos tu presencia en Internet, las opiniones de tus clientes y la actividad sobre tu restaurante">
        <link rel="icon" href="img/favicon.ico" type="image/x-icon" >
        <title>iRestauranting - Indentificarme en iRestauranting</title>
        <link rel="stylesheet" media="all" href="../css/irestauranting.css" >
    	<link rel="stylesheet" media="screen and (max-width: 1023px)" href="../css/irestauranting_tablet.css" >
        <link rel="stylesheet" href="../css/magnific-popup.css" >	
        <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" >
    	<link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'>
</head>

<body>
	<div>
        <div id="resto_header">
        	<div id="header-center">
                <div style="float:left">
                	<a href="../index.html"><img src="../img/LogoHome.png" /></a>
                </div>
                <div style="margin-left:30px;float:left">
                 	<img src="../img/barra_header.png" />
                 </div>
                 <div style="margin-top:20px;margin-left:30px;float:left;">
                 	<a style="text-decoration: none;"  href="../como_funciona.html"><span style="color:#FFF" class="texto_span_16_bold">Cómo funciona</span></a>
                 </div>
                 <div style="margin-left:30px;float:left">
                 	<img src="../img/barra_header.png" />
                 </div>
                 <div  style="margin-top:20px;margin-left:30px;float:left">
                 	<a style="text-decoration: none;" href="../que_te_ofrecemos.html"><span style="color:#FFF" class="texto_span_16_bold">Qué te ofrecemos</span></a>
                 </div>
                 <div style="margin-left:30px;float:left">
                 	<img src="../img/barra_header.png" />
                 </div>
                 <div  style="margin-top:20px;margin-left:30px;float:left">
                 	<a id="contact_form_link" style="text-decoration: none;" href="#contact-popup"><span style="color:#FFF" class="texto_span_16_bold">Contacto</span></a>
                 </div>
             </div>
         </div>
         <div id="separador_header">
         </div>	
         <div style="clear:both" />
         <div id="container_login">
         	<div class="texto_30">Identificarme en iRestauranting</div>
         	<div id="login" style="border-radius:10px;display:block;width:520px;padding:0px 0px 10px;margin:auto">
            	<form id="form_login" style="padding:10px 180px 0px;color:#666">
                    &nbsp;Usuario:<br/>
                    <input  style="height:30px;background:#EEE" type="text" name="user_name" id="user_name" size="30" />
                    <br/><br/>
                	&nbsp;Contraseña:<br/>
                    <input  style="height:30px;background:#EEE" type="password" name="user_password" id="user_password" size="30" />
                	<br/><br/>
                
            		<a id="submit_login"><img style="display: block;margin: 0 auto;cursor:pointer;" src="../img/BotonEntrar.png" /></a>
                    <br/>
                	<div id="validate_login" style="text-align:center;width:100%;position:relative;color:#C03">
                	</div>
                	<br/><br/>
                    <span style="text-align:center;color:#666;display: block;margin: 0 auto;">¿Nuevo en iRestauranting?</span>
                    <a id="submit_register" href="new_user.php"><img style="display: block;margin: 0 auto;cursor:pointer;" src="../img/BotonRegistrarme.png" /></a>
                </form>
            </div>
        </div>
        
     </div>
	 <br><br>
    
    <!--
	<div id="header-center">
		<div style="float:left">
			
		</div>			
	 </div>
     -->
	</div>
    <script src="../js/jquery-1.9.1.js" type="text/javascript"></script>
    <script type="text/javascript">
		$(document).ready(function(){

    		$(document).bind('keypress',pressed);
		});

		function pressed(e)
		{
    		if(e.keyCode === 13)
    		{
        		login_user();
        		//put button.click() here
    		}
		}
	
			var nueva_func = "";
			
			$("#submit_login").click(function() {
				login_user();
			});
			
			function login_user(){
				var url = "user_management.php?login=1";
				
				$.ajax({
					   type: "POST",
					   url: url,
					   data: $("#form_login").serialize(), // serializes the form's elements.
					   success: function(data)
					   {
						   	if(data.trim().length==0)
						   		$("#validate_login").html("Usuario y/o Contraseña incorrectos");
							else
								window.location = "../index.html";	
						   
					   }
					 });
				
				if($("#user_name").length== 0 || $("#user_password").length == 0)
					$("#validate_login").html("Usuario y/o Contraseña incorrectos");
			}
			
			$("#submitButtonId").click(function() {
				
				
				var url = "contact/contact_form.php"; // the script where you handle the form input.
			
				$.ajax({
					   type: "POST",
					   url: url,
					   data: $("#form_contact").serialize(), // serializes the form's elements.
					   success: function(data)
					   {
						  $.magnificPopup.open({
							  items: {
								src: '<div class="white-popup-thanks"><div class="resumen_indicador_graph">Muchas gracias por contactarnos.<br/><br/>Sus comentarios serán analizados por el equipo de iRestauranting</div></div>', 
								type: 'inline',
								midClick: true 
							  }
							});
						   
						 
					   }
					 });
			
				return false; // avoid to execute the actual submit of the form.
			});
			
			$("#signUpId").click(function() {
				var url = "contact/contact_form.php?alta=1&nueva_func=" + nueva_func; // the script where you handle the form input.
			
				$.ajax({
					   type: "POST",
					   url: url,
					   data: $("#form_signup").serialize(), // serializes the form's elements.
					   success: function(data)
					   {
						  	 
							$.magnificPopup.open({
							  items: {
								src: '<div class="white-popup-thanks"><div class="resumen_indicador_graph">Analizaremos tu petición y te enviaremos un correo con la contraseña para acceder al área privada</div><br/><br/><br/><br/><br/><div id="resumen_envio" style="color:#F90" class="resumen_indicador_graph">Muchas gracias por darse de alta</div></div>', 
								type: 'inline',
								midClick: true 
							  }
							});
					   }
					 });
				
				return false;
			});
           
			// Carga del popup del contact form
			$('#contact_form_link').magnificPopup({ 
			  type:'inline',
  			  midClick: true 
			});
			
			// Carga del popup del contact form
			$('#contact_form_link2').magnificPopup({ 
			  type:'inline',
  			  midClick: true 
			});
			
			// Carga del popup de login
			$('.login_form_link').magnificPopup({ 
			  type:'inline',
  			  midClick: true,
			  callbacks : {
				open : function(){
				  var mp = $.magnificPopup.instance,
					  t = $(mp.currItem.el[0]);

				   nueva_func = t.data('custom');
				}
			  }			  
			});
			
			// Carga del popup de login
			$('#signup_form_link').magnificPopup({ 
			  type:'inline',
  			  midClick: true
			  
			  
			});
    </script>
	 <script type="text/javascript">

		var _gaq = _gaq || [];
		_gaq.push(['_setAccount', 'UA-42707380-1']);
		_gaq.push(['_setDomainName', 'irestauranting.com']);
		_gaq.push(['_setDomainName', 'irestauranting.es']);
		_gaq.push(['_setAllowLinker', true]);
		_gaq.push(['_trackPageview']);

		(function() {
		var ga = document.createElement('script'); ga.type = 'text/javascript';
		  ga.async = true;
		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 
		  'http://www') + '.google-analytics.com/ga.js';
		var s = document.getElementsByTagName('script')[0];
		  s.parentNode.insertBefore(ga, s);
		})();

</script>
</body>
</html>